package com.lvshi0797.cms.helper;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CommonUtils {
	public static String arraysToString(String[] arr) {
		StringBuffer sb = new StringBuffer();
		if (arr != null && arr.length > 0) {
			for (String s : arr) {
				sb.append(s).append(",");
			}
			sb.deleteCharAt(sb.length() - 1);
		}
		return sb.toString();
	}

	/**
	 * 判断当前号码是否是手机号，如果是手机号返回true
	 * 
	 * @param mobiles
	 * @return 是手机号返回true
	 */
	public static boolean isMobileNO(String mobiles) {
		Pattern p = Pattern
				.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
		Matcher m = p.matcher(mobiles);
		return m.matches();
	}
	
	

	public static void main(String[] args) {
		/*
		 * String[] str = { "ABC" }; System.out.println(arraysToString(str));
		 */
	}
}
